package com.noble.glamour.ui.user.my.gift;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.noble.glamour.R;
import com.noble.glamour.bean.config.base.Goods;
import com.noble.glamour.module.logic.application.ModuleMgr;
import com.noble.library.base.BaseAppCompatActivity;
import com.noble.glamour.ui.user.my.view.DividerItemDecoration;
import com.noble.library.view.CustomFrameLayout;

import java.util.List;

/**
 * 我的礼物
 */
public class MyGiftActivity extends BaseAppCompatActivity {
    private CustomFrameLayout frameLayout;

    private RecyclerView rlvList;
    private MyGiftAdapter giftAdapter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_gift_list);
        initView();
    }

    private void initView() {
        List<Goods> dataList = ModuleMgr.getCommonMgr().getCommonConfig().getPay().getDiamondList();
        setBackView(R.id.base_title_back, getString(R.string.my_gift, dataList.size()));

        frameLayout = (CustomFrameLayout) findViewById(R.id.gift_frame);
        frameLayout.showOfIndex(1);

        rlvList = (RecyclerView) findViewById(R.id.recycler_view);
        rlvList.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
        rlvList.addItemDecoration(new DividerItemDecoration(this,
                DividerItemDecoration.VERTICAL_LIST, R.drawable.p1_decoration_px1));
        giftAdapter = new MyGiftAdapter(this);

        rlvList.setAdapter(giftAdapter);
        giftAdapter.setList(dataList);
    }
}
